package com.rayc.mall.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rayc.mall.user.domain.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @Author: Ray-C
 * @CreateTime: 2025-03-25
 * @Description: 用户mapper
 * @Version: 1.0
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Update("update user set balance = balance - ${totalFee}, update_time = now() where id = #{userId}")
    void updateMoney(@Param("userId") Long userId, @Param("totalFee") Integer totalFee);
}
